

// source idl: com.erp.employee.dao.idl.EmployeeDao.java

#ifndef EMPLOYEEDAO_STUB_4_WEB_H
#define EMPLOYEEDAO_STUB_4_WEB_H

#include <string>
#include <sstream>
#include "app_platform/cmd_obj.h"
#include "app_platform/cgi_stub_cntl.h"
#include "c2cent/base/basestub4web.h"
#include "app_platform/cntl_info.h"
#include "app_platform/intf_serializable.h"
#include "app_platform/intf_service_object.h"
#include "erp/employee/ddo/employeefilterddo_employee.h"	
#include <set>	
#include <map>	
#include "erp/employee/ddo/employeeddo_employee.h"	
#include "intf_employeedao.h"

namespace erp
{
namespace employee
{
namespace dao
{
	#define EMPLOYEEDAO_STUB4WEB_VERSION "ERP_EMPLOYEE_DAO___EMPLOYEEDAO__STUB4WEB_VERSION__1.0 2013-10-18 14:07:50"
    const std::string EMPLOYEEDAO_STUB4WEB_NOUSE = EMPLOYEEDAO_STUB4WEB_VERSION;

	const uint32_t EMPLOYEEDAO_ADDEMPLOYEE_REQ_CMD_ID = 0xC00B1802; /// 请求命令号
	const uint32_t EMPLOYEEDAO_ADDEMPLOYEE_RESP_CMD_ID = 0xC00B8802; /// 回应命令号
	

	const uint32_t EMPLOYEEDAO_DELETEEMPLOYEE_REQ_CMD_ID = 0xC00B1804; /// 请求命令号
	const uint32_t EMPLOYEEDAO_DELETEEMPLOYEE_RESP_CMD_ID = 0xC00B8804; /// 回应命令号
	

	const uint32_t EMPLOYEEDAO_GETEMPLOYEEBYID_REQ_CMD_ID = 0xC00B1801; /// 请求命令号
	const uint32_t EMPLOYEEDAO_GETEMPLOYEEBYID_RESP_CMD_ID = 0xC00B8801; /// 回应命令号
	

	const uint32_t EMPLOYEEDAO_UPDATEEMPLOYEE_REQ_CMD_ID = 0xC00B1803; /// 请求命令号
	const uint32_t EMPLOYEEDAO_UPDATEEMPLOYEE_RESP_CMD_ID = 0xC00B8803; /// 回应命令号
	


	const uint16_t EMPLOYEEDAO_MAX_PROTOCAL_VERSION = 2; //>平台支持的最大协议版本号

///////////////////////////// STRUCTS /////////////////////////////////////////////////
	/**
	 *
 	 * 
	 *
	 *
 	 * @date 2013-10-18 14:07:50
 	 * @version 0
	 */	
	struct CAddEmployeeReq : public IServiceObject, public ISerializableXML
	{
		std::string machineKey;
		std::string source;
		uint32_t sceneId;
		erp::employee::ddo::CEmployeeDdo employee;
		std::string inReserve;
		std::string errmsg;
		erp::employee::ddo::CEmployeeDdo employeeBack;
		std::string outReserve;
		
	    virtual uint32_t getCmdId() const { return EMPLOYEEDAO_ADDEMPLOYEE_REQ_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
			//检查协议的版本号
		    //if(bs.getVersion() > EMPLOYEEDAO_MAX_PROTOCAL_VERSION)
		    //return false;
			bs & machineKey;
			bs & source;
			bs & sceneId;
			employee.Serialize(bs);
			bs & inReserve;
		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	
	/**
	 *
 	 * 
	 *
 	 * @date 2013-10-18 14:07:50
 	 * @version 0
	 */	
	struct CAddEmployeeResp : public IServiceObject, public ISerializableXML
	{
		uint32_t dwResult;
		std::string errmsg;
		erp::employee::ddo::CEmployeeDdo employeeBack;
		std::string outReserve;
	
	    virtual uint32_t getCmdId() const { return EMPLOYEEDAO_ADDEMPLOYEE_RESP_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
		    bs & dwResult;
			bs & errmsg;
			employeeBack.Serialize(bs);
			bs & outReserve;
		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	/**
	 *
 	 * 
	 *
	 *
 	 * @date 2013-10-18 14:07:50
 	 * @version 0
	 */	
	struct CDeleteEmployeeReq : public IServiceObject, public ISerializableXML
	{
		std::string machineKey;
		std::string source;
		uint32_t sceneId;
		erp::employee::ddo::CEmployeeDdo employee;
		std::string inReserve;
		std::string errmsg;
		std::string outReserve;
		
	    virtual uint32_t getCmdId() const { return EMPLOYEEDAO_DELETEEMPLOYEE_REQ_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
			//检查协议的版本号
		    //if(bs.getVersion() > EMPLOYEEDAO_MAX_PROTOCAL_VERSION)
		    //return false;
			bs & machineKey;
			bs & source;
			bs & sceneId;
			employee.Serialize(bs);
			bs & inReserve;
		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	
	/**
	 *
 	 * 
	 *
 	 * @date 2013-10-18 14:07:50
 	 * @version 0
	 */	
	struct CDeleteEmployeeResp : public IServiceObject, public ISerializableXML
	{
		uint32_t dwResult;
		std::string errmsg;
		std::string outReserve;
	
	    virtual uint32_t getCmdId() const { return EMPLOYEEDAO_DELETEEMPLOYEE_RESP_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
		    bs & dwResult;
			bs & errmsg;
			bs & outReserve;
		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	/**
	 *
 	 * 
	 *
	 *
 	 * @date 2013-10-18 14:07:50
 	 * @version 0
	 */	
	struct CGetEmployeeByIdReq : public IServiceObject, public ISerializableXML
	{
		std::string machineKey;
		std::string source;
		uint32_t sceneId;
		erp::employee::ddo::CEmployeeFilterDdo employeeFilter;
		std::string inReserve;
		std::string errmsg;
		std::map<uint32_t,erp::employee::ddo::CEmployeeDdo > employees;
		std::string outReserve;
		
	    virtual uint32_t getCmdId() const { return EMPLOYEEDAO_GETEMPLOYEEBYID_REQ_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
			//检查协议的版本号
		    //if(bs.getVersion() > EMPLOYEEDAO_MAX_PROTOCAL_VERSION)
		    //return false;
			bs & machineKey;
			bs & source;
			bs & sceneId;
			employeeFilter.Serialize(bs);
			bs & inReserve;
		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	
	/**
	 *
 	 * 
	 *
 	 * @date 2013-10-18 14:07:50
 	 * @version 0
	 */	
	struct CGetEmployeeByIdResp : public IServiceObject, public ISerializableXML
	{
		uint32_t dwResult;
		std::string errmsg;
		std::map<uint32_t,erp::employee::ddo::CEmployeeDdo > employees;
		std::string outReserve;
	
	    virtual uint32_t getCmdId() const { return EMPLOYEEDAO_GETEMPLOYEEBYID_RESP_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
		    bs & dwResult;
			bs & errmsg;
			bs & employees;
			bs & outReserve;
		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	/**
	 *
 	 * 
	 *
	 *
 	 * @date 2013-10-18 14:07:50
 	 * @version 0
	 */	
	struct CUpdateEmployeeReq : public IServiceObject, public ISerializableXML
	{
		std::string machineKey;
		std::string source;
		uint32_t sceneId;
		erp::employee::ddo::CEmployeeDdo employee;
		std::string inReserve;
		std::string errmsg;
		erp::employee::ddo::CEmployeeDdo employeeBack;
		std::string outReserve;
		
	    virtual uint32_t getCmdId() const { return EMPLOYEEDAO_UPDATEEMPLOYEE_REQ_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
			//检查协议的版本号
		    //if(bs.getVersion() > EMPLOYEEDAO_MAX_PROTOCAL_VERSION)
		    //return false;
			bs & machineKey;
			bs & source;
			bs & sceneId;
			employee.Serialize(bs);
			bs & inReserve;
		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	
	/**
	 *
 	 * 
	 *
 	 * @date 2013-10-18 14:07:50
 	 * @version 0
	 */	
	struct CUpdateEmployeeResp : public IServiceObject, public ISerializableXML
	{
		uint32_t dwResult;
		std::string errmsg;
		erp::employee::ddo::CEmployeeDdo employeeBack;
		std::string outReserve;
	
	    virtual uint32_t getCmdId() const { return EMPLOYEEDAO_UPDATEEMPLOYEE_RESP_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
		    bs & dwResult;
			bs & errmsg;
			employeeBack.Serialize(bs);
			bs & outReserve;
		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	class CEmployeeDaoStub4Web : public c2cent::CBaseStub4Web, public IEmployeeDao	{
		public:
			uint32_t AddEmployee(
				const CCntlInfo& rCntlInfo,

				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const erp::employee::ddo::CEmployeeDdo& employee,
				const std::string& inReserve,
				std::string& errmsg,
				erp::employee::ddo::CEmployeeDdo& employeeBack,
				std::string& outReserve
			);
			uint32_t DeleteEmployee(
				const CCntlInfo& rCntlInfo,

				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const erp::employee::ddo::CEmployeeDdo& employee,
				const std::string& inReserve,
				std::string& errmsg,
				std::string& outReserve
			);
			uint32_t GetEmployeeById(
				const CCntlInfo& rCntlInfo,

				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const erp::employee::ddo::CEmployeeFilterDdo& employeeFilter,
				const std::string& inReserve,
				std::string& errmsg,
				std::map<uint32_t,erp::employee::ddo::CEmployeeDdo >& employees,
				std::string& outReserve
			);
			uint32_t UpdateEmployee(
				const CCntlInfo& rCntlInfo,

				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const erp::employee::ddo::CEmployeeDdo& employee,
				const std::string& inReserve,
				std::string& errmsg,
				erp::employee::ddo::CEmployeeDdo& employeeBack,
				std::string& outReserve
			);
	};
	
	/**
	 *
 	 *  写入员工信息 
	 *
		 *@param String machineKey: 机器码，必填  				
		 *@param String source: 调用来源，必填  				
		 *@param uint32_t sceneId: 场景id，必填  				
		 *@param EmployeeDdo employee: 员工信息列表，必填  				
		 *@param String inReserve: 请求保留字  				
		 *@param String errmsg: 错误信息  		
		 *@param EmployeeDdo employeeBack: 员工信息列表，必填  		
		 *@param String outReserve: 返回保留字   		
     *
     *@return uint32_t : 0(成功) 其它失败
	 */	
	inline uint32_t CEmployeeDaoStub4Web::AddEmployee(
				const CCntlInfo& rCntlInfo,

				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const erp::employee::ddo::CEmployeeDdo& employee,
				const std::string& inReserve,
				std::string& errmsg,
				erp::employee::ddo::CEmployeeDdo& employeeBack,
				std::string& outReserve
	)
	{
		 CAddEmployeeReq oReq;
			oReq.machineKey = machineKey;
			oReq.source = source;
			oReq.sceneId = sceneId;
			oReq.employee = employee;
			oReq.inReserve = inReserve;
			oReq.errmsg = errmsg;
			oReq.employeeBack = employeeBack;
			oReq.outReserve = outReserve;
		 
		// CCGI_STUB_CNTL->setRouteKey(uint32_t routeKey); 没有设置routeKey  
		
	    CCGI_STUB_CNTL->setPassport(
	        rCntlInfo.getOperatorUin(), 
	        rCntlInfo.getOperatorKey().c_str(),
	        rCntlInfo.getOperatorClientIP());
	
		if(const_cast<CCntlInfo&>(rCntlInfo).isRouteKeySet())	
			CCGI_STUB_CNTL->setUin(const_cast<CCntlInfo&>(rCntlInfo).getRouteKey());	
	    
	    int iRetCode = 0;
		m_sErrMsg.clear();
		if((iRetCode = CCGI_STUB_CNTL->putSvcObj(&oReq, 0)) != 0)
	    {
			m_sErrMsg = "DoRequest failed: ";
			m_sErrMsg += CCGI_STUB_CNTL->GetLastErrMsg();
	        return iRetCode;
	    }
	    
	    // Send & Recv
		if((iRetCode = SendRecv()) != 0)
		{
			if(99 == iRetCode) // UDP & Need No Response
				return 0;
	
			std::stringstream oss;
			oss << m_lTimeout;
	        m_sErrMsg = "Send & Recv Timeout(";
			m_sErrMsg += oss.str();
			m_sErrMsg += "s) ";
			m_sErrMsg += CCGI_STUB_CNTL->GetLastErrMsg();
			return iRetCode;
	    }
	    
		if(!m_poCmd->isValid(EMPLOYEEDAO_ADDEMPLOYEE_RESP_CMD_ID))
	    {
	        std::stringstream oss;
            oss << "Cmd not match: "
                << "Expected cmd=" << std::hex << EMPLOYEEDAO_ADDEMPLOYEE_RESP_CMD_ID << std::dec << " != "
                << "actualed cmd=" << std::hex << m_poCmd->getCmdId() << std::dec;
            m_sErrMsg = oss.str();
        
	        return 0xEE0024;
	    }
	    
	    char* pBuf = NULL; uint32_t nLen = 0;
	    m_poCmd->getBuffer(pBuf, nLen);
	    CByteStreamNetwork bs(pBuf, nLen);
	    bs.isStoring(false);
	    
	    CAddEmployeeResp oResp;
	    if(!oResp.Serialize(bs))
	    {
	        m_sErrMsg = "Resp.Serialize(bs) failed";
	        return 0xEE0028;
	    }
		    
			errmsg  = oResp.errmsg;
			employeeBack  = oResp.employeeBack;
			outReserve  = oResp.outReserve;
		    
		return oResp.dwResult;
	}
	/**
	 *
 	 *  删除员工信息 
	 *
		 *@param String machineKey: 机器码，必填  				
		 *@param String source: 调用来源，必填  				
		 *@param uint32_t sceneId: 场景id，必填  				
		 *@param EmployeeDdo employee: 员工信息列表，必填  				
		 *@param String inReserve: 请求保留字  				
		 *@param String errmsg: 错误信息  		
		 *@param String outReserve: 返回保留字   		
     *
     *@return uint32_t : 0(成功) 其它失败
	 */	
	inline uint32_t CEmployeeDaoStub4Web::DeleteEmployee(
				const CCntlInfo& rCntlInfo,

				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const erp::employee::ddo::CEmployeeDdo& employee,
				const std::string& inReserve,
				std::string& errmsg,
				std::string& outReserve
	)
	{
		 CDeleteEmployeeReq oReq;
			oReq.machineKey = machineKey;
			oReq.source = source;
			oReq.sceneId = sceneId;
			oReq.employee = employee;
			oReq.inReserve = inReserve;
			oReq.errmsg = errmsg;
			oReq.outReserve = outReserve;
		 
		// CCGI_STUB_CNTL->setRouteKey(uint32_t routeKey); 没有设置routeKey  
		
	    CCGI_STUB_CNTL->setPassport(
	        rCntlInfo.getOperatorUin(), 
	        rCntlInfo.getOperatorKey().c_str(),
	        rCntlInfo.getOperatorClientIP());
	
		if(const_cast<CCntlInfo&>(rCntlInfo).isRouteKeySet())	
			CCGI_STUB_CNTL->setUin(const_cast<CCntlInfo&>(rCntlInfo).getRouteKey());	
	    
	    int iRetCode = 0;
		m_sErrMsg.clear();
		if((iRetCode = CCGI_STUB_CNTL->putSvcObj(&oReq, 0)) != 0)
	    {
			m_sErrMsg = "DoRequest failed: ";
			m_sErrMsg += CCGI_STUB_CNTL->GetLastErrMsg();
	        return iRetCode;
	    }
	    
	    // Send & Recv
		if((iRetCode = SendRecv()) != 0)
		{
			if(99 == iRetCode) // UDP & Need No Response
				return 0;
	
			std::stringstream oss;
			oss << m_lTimeout;
	        m_sErrMsg = "Send & Recv Timeout(";
			m_sErrMsg += oss.str();
			m_sErrMsg += "s) ";
			m_sErrMsg += CCGI_STUB_CNTL->GetLastErrMsg();
			return iRetCode;
	    }
	    
		if(!m_poCmd->isValid(EMPLOYEEDAO_DELETEEMPLOYEE_RESP_CMD_ID))
	    {
	        std::stringstream oss;
            oss << "Cmd not match: "
                << "Expected cmd=" << std::hex << EMPLOYEEDAO_DELETEEMPLOYEE_RESP_CMD_ID << std::dec << " != "
                << "actualed cmd=" << std::hex << m_poCmd->getCmdId() << std::dec;
            m_sErrMsg = oss.str();
        
	        return 0xEE0024;
	    }
	    
	    char* pBuf = NULL; uint32_t nLen = 0;
	    m_poCmd->getBuffer(pBuf, nLen);
	    CByteStreamNetwork bs(pBuf, nLen);
	    bs.isStoring(false);
	    
	    CDeleteEmployeeResp oResp;
	    if(!oResp.Serialize(bs))
	    {
	        m_sErrMsg = "Resp.Serialize(bs) failed";
	        return 0xEE0028;
	    }
		    
			errmsg  = oResp.errmsg;
			outReserve  = oResp.outReserve;
		    
		return oResp.dwResult;
	}
	/**
	 *
 	 *  根据ID获取员工信息 
	 *
		 *@param String machineKey: 机器码，必填  				
		 *@param String source: 调用来源，必填  				
		 *@param uint32_t sceneId: 场景id，必填  				
		 *@param EmployeeFilterDdo employeeFilter: 过滤器，必填  				
		 *@param String inReserve: 请求保留字  				
		 *@param String errmsg: 错误信息  		
		 *@param Map employees: 员工信息  		
		 *@param String outReserve: 返回保留字   		
     *
     *@return uint32_t : 0(成功) 其它失败
	 */	
	inline uint32_t CEmployeeDaoStub4Web::GetEmployeeById(
				const CCntlInfo& rCntlInfo,

				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const erp::employee::ddo::CEmployeeFilterDdo& employeeFilter,
				const std::string& inReserve,
				std::string& errmsg,
				std::map<uint32_t,erp::employee::ddo::CEmployeeDdo >& employees,
				std::string& outReserve
	)
	{
		 CGetEmployeeByIdReq oReq;
			oReq.machineKey = machineKey;
			oReq.source = source;
			oReq.sceneId = sceneId;
			oReq.employeeFilter = employeeFilter;
			oReq.inReserve = inReserve;
			oReq.errmsg = errmsg;
			oReq.employees = employees;
			oReq.outReserve = outReserve;
		 
		// CCGI_STUB_CNTL->setRouteKey(uint32_t routeKey); 没有设置routeKey  
		
	    CCGI_STUB_CNTL->setPassport(
	        rCntlInfo.getOperatorUin(), 
	        rCntlInfo.getOperatorKey().c_str(),
	        rCntlInfo.getOperatorClientIP());
	
		if(const_cast<CCntlInfo&>(rCntlInfo).isRouteKeySet())	
			CCGI_STUB_CNTL->setUin(const_cast<CCntlInfo&>(rCntlInfo).getRouteKey());	
	    
	    int iRetCode = 0;
		m_sErrMsg.clear();
		if((iRetCode = CCGI_STUB_CNTL->putSvcObj(&oReq, 0)) != 0)
	    {
			m_sErrMsg = "DoRequest failed: ";
			m_sErrMsg += CCGI_STUB_CNTL->GetLastErrMsg();
	        return iRetCode;
	    }
	    
	    // Send & Recv
		if((iRetCode = SendRecv()) != 0)
		{
			if(99 == iRetCode) // UDP & Need No Response
				return 0;
	
			std::stringstream oss;
			oss << m_lTimeout;
	        m_sErrMsg = "Send & Recv Timeout(";
			m_sErrMsg += oss.str();
			m_sErrMsg += "s) ";
			m_sErrMsg += CCGI_STUB_CNTL->GetLastErrMsg();
			return iRetCode;
	    }
	    
		if(!m_poCmd->isValid(EMPLOYEEDAO_GETEMPLOYEEBYID_RESP_CMD_ID))
	    {
	        std::stringstream oss;
            oss << "Cmd not match: "
                << "Expected cmd=" << std::hex << EMPLOYEEDAO_GETEMPLOYEEBYID_RESP_CMD_ID << std::dec << " != "
                << "actualed cmd=" << std::hex << m_poCmd->getCmdId() << std::dec;
            m_sErrMsg = oss.str();
        
	        return 0xEE0024;
	    }
	    
	    char* pBuf = NULL; uint32_t nLen = 0;
	    m_poCmd->getBuffer(pBuf, nLen);
	    CByteStreamNetwork bs(pBuf, nLen);
	    bs.isStoring(false);
	    
	    CGetEmployeeByIdResp oResp;
	    if(!oResp.Serialize(bs))
	    {
	        m_sErrMsg = "Resp.Serialize(bs) failed";
	        return 0xEE0028;
	    }
		    
			errmsg  = oResp.errmsg;
			employees  = oResp.employees;
			outReserve  = oResp.outReserve;
		    
		return oResp.dwResult;
	}
	/**
	 *
 	 *  修改员工信息 
	 *
		 *@param String machineKey: 机器码，必填  				
		 *@param String source: 调用来源，必填  				
		 *@param uint32_t sceneId: 场景id，必填  				
		 *@param EmployeeDdo employee: 员工信息列表，必填  				
		 *@param String inReserve: 请求保留字  				
		 *@param String errmsg: 错误信息  		
		 *@param EmployeeDdo employeeBack: 员工信息列表，必填  		
		 *@param String outReserve: 返回保留字   		
     *
     *@return uint32_t : 0(成功) 其它失败
	 */	
	inline uint32_t CEmployeeDaoStub4Web::UpdateEmployee(
				const CCntlInfo& rCntlInfo,

				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				const erp::employee::ddo::CEmployeeDdo& employee,
				const std::string& inReserve,
				std::string& errmsg,
				erp::employee::ddo::CEmployeeDdo& employeeBack,
				std::string& outReserve
	)
	{
		 CUpdateEmployeeReq oReq;
			oReq.machineKey = machineKey;
			oReq.source = source;
			oReq.sceneId = sceneId;
			oReq.employee = employee;
			oReq.inReserve = inReserve;
			oReq.errmsg = errmsg;
			oReq.employeeBack = employeeBack;
			oReq.outReserve = outReserve;
		 
		// CCGI_STUB_CNTL->setRouteKey(uint32_t routeKey); 没有设置routeKey  
		
	    CCGI_STUB_CNTL->setPassport(
	        rCntlInfo.getOperatorUin(), 
	        rCntlInfo.getOperatorKey().c_str(),
	        rCntlInfo.getOperatorClientIP());
	
		if(const_cast<CCntlInfo&>(rCntlInfo).isRouteKeySet())	
			CCGI_STUB_CNTL->setUin(const_cast<CCntlInfo&>(rCntlInfo).getRouteKey());	
	    
	    int iRetCode = 0;
		m_sErrMsg.clear();
		if((iRetCode = CCGI_STUB_CNTL->putSvcObj(&oReq, 0)) != 0)
	    {
			m_sErrMsg = "DoRequest failed: ";
			m_sErrMsg += CCGI_STUB_CNTL->GetLastErrMsg();
	        return iRetCode;
	    }
	    
	    // Send & Recv
		if((iRetCode = SendRecv()) != 0)
		{
			if(99 == iRetCode) // UDP & Need No Response
				return 0;
	
			std::stringstream oss;
			oss << m_lTimeout;
	        m_sErrMsg = "Send & Recv Timeout(";
			m_sErrMsg += oss.str();
			m_sErrMsg += "s) ";
			m_sErrMsg += CCGI_STUB_CNTL->GetLastErrMsg();
			return iRetCode;
	    }
	    
		if(!m_poCmd->isValid(EMPLOYEEDAO_UPDATEEMPLOYEE_RESP_CMD_ID))
	    {
	        std::stringstream oss;
            oss << "Cmd not match: "
                << "Expected cmd=" << std::hex << EMPLOYEEDAO_UPDATEEMPLOYEE_RESP_CMD_ID << std::dec << " != "
                << "actualed cmd=" << std::hex << m_poCmd->getCmdId() << std::dec;
            m_sErrMsg = oss.str();
        
	        return 0xEE0024;
	    }
	    
	    char* pBuf = NULL; uint32_t nLen = 0;
	    m_poCmd->getBuffer(pBuf, nLen);
	    CByteStreamNetwork bs(pBuf, nLen);
	    bs.isStoring(false);
	    
	    CUpdateEmployeeResp oResp;
	    if(!oResp.Serialize(bs))
	    {
	        m_sErrMsg = "Resp.Serialize(bs) failed";
	        return 0xEE0028;
	    }
		    
			errmsg  = oResp.errmsg;
			employeeBack  = oResp.employeeBack;
			outReserve  = oResp.outReserve;
		    
		return oResp.dwResult;
	}
		
}
}
}

#endif /* EMPLOYEEDAO_STUB_4_WEB_H */
